package com.heboan.www;

/*
    编程找出1000以内的所有完数并打印
*/

public class Demo02 {
    public static void main(String[] args) {


        for (int i=1; i<=1000; i++) {
            int j;
            int sum =0;
            for (j=1; j<= i-1; j++) {
                if (i % j == 0) {
                    sum += j;
                }
            }
            if (sum == j){
                System.out.println(sum);
            }
        }
    }
}

